package com.hr.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.hr.model.DialogModel;
import com.hr.service.DialogService;

/**
 *  网页弹出框controller
 * @author fazhen.zheng
 *
 */
@Controller
public class DialogController {
	@Autowired
	private DialogService dialogService;
	
	/**
	 * 查询所有部门
	 * @return
	 */
	@RequestMapping("/dialog.html")
	public ModelAndView dialog(String type){
		List<DialogModel> dialogModels = dialogService.generateModel(type);
		ModelAndView mv = new ModelAndView("/dialog");
		mv.addObject("dialogModels", dialogModels);
		return mv;
	}
	
}
